<template>
  <div class="messageList">
    <div class="fixedBox headerBox">
      <van-nav-bar title="消息" left-arrow @click-left="goBack" />
    </div>
    <div v-if="getArticleList&&getArticleList.length>0" :style="{'paddingTop': `calc(${1+'rem + '+$headerH+'px'})`}">
      <van-cell v-for="(item,index) in getArticleList" :key="index" title="官方通知" center  is-link :to="`messageInfo?id=${item.id}`" size="large" :label="item.name" />
      <p></p>
    </div>
    <div class="noWallet" v-if="getArticleList&&getArticleList.length==0&&onload">
      <img src="@/assets/img/goods/img_xiaoxi@2x.png" alt="">
      <p>暂无消息</p>
    </div>
  </div>
</template>


<script>
export default {
  data() {
    return {
       onload:false,
       getArticleList:[]
    };
  },
  created() {
    this.getArticleListFunc()
  },
  methods: {
    async getArticleListFunc(){
        this.$toast.loading({
            message: '加载中...',
            forbidClick: true,
        });
        let res = await this.$http.userArticleList({page: 1,examine:3,type:14});
        if (res) {
          this.getArticleList=res.data.list
          this.$toast.clear()
          this.onload=true
        } else {
          this.$toast.clear()
        }
    },
    goBack(){
      this.$router.push({name:'index'})
    }
  }
};
</script>
<style scoped>
.messageList{
  background: #fff;
  min-height: 100vh;
}
.noWallet{
  text-align: center;
  font-size: 0.32rem;
  color: #999;
}
.noWallet img{
  width: 100%;
  margin-top: 1.3rem;
}
.fixedBox{
  position: fixed;
  width: 100%;
  z-index: 1;
  background: #fff;
}
</style>
